package models;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "Vehicle")
public class VehicleEntity {
    private int vehicleId;
    private String plateNo;
    private String type;
    private String industry;
    private String unit;
    private String monitor;
    private Double weight;
    private String driver;
    private String status;
    private String runStatus;
    private Double total;
    private Double remain;
    private Double initRemain;
    private Boolean deleted;
    private Timestamp createDate;
    private Integer tenantId;
    private String gpsId;
    private Integer depId;
    private Integer color;
    private String videoDeviceId;
    private String gpsTerminalType;
    private Integer sortId;
    private Integer motorId;
    private Timestamp installDate;
    private Boolean authorize;
    private String simNo;
    private String dvrCard;
    private String driverMobile;
    private String monitorMobile;
    private String loginName;
    private Timestamp logTime;
    private String password;
    private String listenIp;
    private String listenPort;
    private String routes;
    private Timestamp lastCheckTime;
    private Timestamp updateLogDate;
    private Timestamp onlineTime;
    private Timestamp offlineTime;

    @Id
    @Column(name = "VehicleId", nullable = false)
    public int getVehicleId() {
        return vehicleId;
    }

    public void setVehicleId(int vehicleId) {
        this.vehicleId = vehicleId;
    }

    @Basic
    @Column(name = "PlateNo", nullable = true, length = 255)
    public String getPlateNo() {
        return plateNo;
    }

    public void setPlateNo(String plateNo) {
        this.plateNo = plateNo;
    }

    @Basic
    @Column(name = "Type", nullable = true, length = 255)
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Basic
    @Column(name = "Industry", nullable = true, length = 255)
    public String getIndustry() {
        return industry;
    }

    public void setIndustry(String industry) {
        this.industry = industry;
    }

    @Basic
    @Column(name = "Unit", nullable = true, length = 255)
    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    @Basic
    @Column(name = "Monitor", nullable = true, length = 255)
    public String getMonitor() {
        return monitor;
    }

    public void setMonitor(String monitor) {
        this.monitor = monitor;
    }

    @Basic
    @Column(name = "Weight", nullable = true, precision = 0)
    public Double getWeight() {
        return weight;
    }

    public void setWeight(Double weight) {
        this.weight = weight;
    }

    @Basic
    @Column(name = "Driver", nullable = true, length = 255)
    public String getDriver() {
        return driver;
    }

    public void setDriver(String driver) {
        this.driver = driver;
    }

    @Basic
    @Column(name = "Status", nullable = true, length = 255)
    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Basic
    @Column(name = "RunStatus", nullable = true, length = 255)
    public String getRunStatus() {
        return runStatus;
    }

    public void setRunStatus(String runStatus) {
        this.runStatus = runStatus;
    }

    @Basic
    @Column(name = "Total", nullable = true, precision = 0)
    public Double getTotal() {
        return total;
    }

    public void setTotal(Double total) {
        this.total = total;
    }

    @Basic
    @Column(name = "Remain", nullable = true, precision = 0)
    public Double getRemain() {
        return remain;
    }

    public void setRemain(Double remain) {
        this.remain = remain;
    }

    @Basic
    @Column(name = "InitRemain", nullable = true, precision = 0)
    public Double getInitRemain() {
        return initRemain;
    }

    public void setInitRemain(Double initRemain) {
        this.initRemain = initRemain;
    }

    @Basic
    @Column(name = "Deleted", nullable = true)
    public Boolean getDeleted() {
        return deleted;
    }

    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    @Basic
    @Column(name = "CreateDate", nullable = true)
    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    @Basic
    @Column(name = "TenantId", nullable = true)
    public Integer getTenantId() {
        return tenantId;
    }

    public void setTenantId(Integer tenantId) {
        this.tenantId = tenantId;
    }

    @Basic
    @Column(name = "GPSId", nullable = true, length = 255)
    public String getGpsId() {
        return gpsId;
    }

    public void setGpsId(String gpsId) {
        this.gpsId = gpsId;
    }

    @Basic
    @Column(name = "DepId", nullable = true)
    public Integer getDepId() {
        return depId;
    }

    public void setDepId(Integer depId) {
        this.depId = depId;
    }

    @Basic
    @Column(name = "Color", nullable = true)
    public Integer getColor() {
        return color;
    }

    public void setColor(Integer color) {
        this.color = color;
    }

    @Basic
    @Column(name = "VideoDeviceId", nullable = true, length = 255)
    public String getVideoDeviceId() {
        return videoDeviceId;
    }

    public void setVideoDeviceId(String videoDeviceId) {
        this.videoDeviceId = videoDeviceId;
    }

    @Basic
    @Column(name = "GpsTerminalType", nullable = true, length = 255)
    public String getGpsTerminalType() {
        return gpsTerminalType;
    }

    public void setGpsTerminalType(String gpsTerminalType) {
        this.gpsTerminalType = gpsTerminalType;
    }

    @Basic
    @Column(name = "SortId", nullable = true)
    public Integer getSortId() {
        return sortId;
    }

    public void setSortId(Integer sortId) {
        this.sortId = sortId;
    }

    @Basic
    @Column(name = "MotorID", nullable = true)
    public Integer getMotorId() {
        return motorId;
    }

    public void setMotorId(Integer motorId) {
        this.motorId = motorId;
    }

    @Basic
    @Column(name = "InstallDate", nullable = true)
    public Timestamp getInstallDate() {
        return installDate;
    }

    public void setInstallDate(Timestamp installDate) {
        this.installDate = installDate;
    }

    @Basic
    @Column(name = "Authorize", nullable = true)
    public Boolean getAuthorize() {
        return authorize;
    }

    public void setAuthorize(Boolean authorize) {
        this.authorize = authorize;
    }

    @Basic
    @Column(name = "SimNo", nullable = true, length = 255)
    public String getSimNo() {
        return simNo;
    }

    public void setSimNo(String simNo) {
        this.simNo = simNo;
    }

    @Basic
    @Column(name = "DVRCard", nullable = true, length = 255)
    public String getDvrCard() {
        return dvrCard;
    }

    public void setDvrCard(String dvrCard) {
        this.dvrCard = dvrCard;
    }

    @Basic
    @Column(name = "DriverMobile", nullable = true, length = 255)
    public String getDriverMobile() {
        return driverMobile;
    }

    public void setDriverMobile(String driverMobile) {
        this.driverMobile = driverMobile;
    }

    @Basic
    @Column(name = "MonitorMobile", nullable = true, length = 255)
    public String getMonitorMobile() {
        return monitorMobile;
    }

    public void setMonitorMobile(String monitorMobile) {
        this.monitorMobile = monitorMobile;
    }

    @Basic
    @Column(name = "LoginName", nullable = true, length = 255)
    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    @Basic
    @Column(name = "LogTime", nullable = true)
    public Timestamp getLogTime() {
        return logTime;
    }

    public void setLogTime(Timestamp logTime) {
        this.logTime = logTime;
    }

    @Basic
    @Column(name = "Password", nullable = true, length = 255)
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Basic
    @Column(name = "ListenIp", nullable = true, length = 255)
    public String getListenIp() {
        return listenIp;
    }

    public void setListenIp(String listenIp) {
        this.listenIp = listenIp;
    }

    @Basic
    @Column(name = "ListenPort", nullable = true, length = 255)
    public String getListenPort() {
        return listenPort;
    }

    public void setListenPort(String listenPort) {
        this.listenPort = listenPort;
    }

    @Basic
    @Column(name = "Routes", nullable = true, length = 255)
    public String getRoutes() {
        return routes;
    }

    public void setRoutes(String routes) {
        this.routes = routes;
    }

    @Basic
    @Column(name = "LastCheckTime", nullable = true)
    public Timestamp getLastCheckTime() {
        return lastCheckTime;
    }

    public void setLastCheckTime(Timestamp lastCheckTime) {
        this.lastCheckTime = lastCheckTime;
    }

    @Basic
    @Column(name = "UpdateLogDate", nullable = true)
    public Timestamp getUpdateLogDate() {
        return updateLogDate;
    }

    public void setUpdateLogDate(Timestamp updateLogDate) {
        this.updateLogDate = updateLogDate;
    }

    @Basic
    @Column(name = "OnlineTime", nullable = true)
    public Timestamp getOnlineTime() {
        return onlineTime;
    }

    public void setOnlineTime(Timestamp onlineTime) {
        this.onlineTime = onlineTime;
    }

    @Basic
    @Column(name = "OfflineTime", nullable = true)
    public Timestamp getOfflineTime() {
        return offlineTime;
    }

    public void setOfflineTime(Timestamp offlineTime) {
        this.offlineTime = offlineTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        VehicleEntity that = (VehicleEntity) o;
        return vehicleId == that.vehicleId &&
                Objects.equals(plateNo, that.plateNo) &&
                Objects.equals(type, that.type) &&
                Objects.equals(industry, that.industry) &&
                Objects.equals(unit, that.unit) &&
                Objects.equals(monitor, that.monitor) &&
                Objects.equals(weight, that.weight) &&
                Objects.equals(driver, that.driver) &&
                Objects.equals(status, that.status) &&
                Objects.equals(runStatus, that.runStatus) &&
                Objects.equals(total, that.total) &&
                Objects.equals(remain, that.remain) &&
                Objects.equals(initRemain, that.initRemain) &&
                Objects.equals(deleted, that.deleted) &&
                Objects.equals(createDate, that.createDate) &&
                Objects.equals(tenantId, that.tenantId) &&
                Objects.equals(gpsId, that.gpsId) &&
                Objects.equals(depId, that.depId) &&
                Objects.equals(color, that.color) &&
                Objects.equals(videoDeviceId, that.videoDeviceId) &&
                Objects.equals(gpsTerminalType, that.gpsTerminalType) &&
                Objects.equals(sortId, that.sortId) &&
                Objects.equals(motorId, that.motorId) &&
                Objects.equals(installDate, that.installDate) &&
                Objects.equals(authorize, that.authorize) &&
                Objects.equals(simNo, that.simNo) &&
                Objects.equals(dvrCard, that.dvrCard) &&
                Objects.equals(driverMobile, that.driverMobile) &&
                Objects.equals(monitorMobile, that.monitorMobile) &&
                Objects.equals(loginName, that.loginName) &&
                Objects.equals(logTime, that.logTime) &&
                Objects.equals(password, that.password) &&
                Objects.equals(listenIp, that.listenIp) &&
                Objects.equals(listenPort, that.listenPort) &&
                Objects.equals(routes, that.routes) &&
                Objects.equals(lastCheckTime, that.lastCheckTime) &&
                Objects.equals(updateLogDate, that.updateLogDate) &&
                Objects.equals(onlineTime, that.onlineTime) &&
                Objects.equals(offlineTime, that.offlineTime);
    }

    @Override
    public int hashCode() {

        return Objects.hash(vehicleId, plateNo, type, industry, unit, monitor, weight, driver, status, runStatus, total, remain, initRemain, deleted, createDate, tenantId, gpsId, depId, color, videoDeviceId, gpsTerminalType, sortId, motorId, installDate, authorize, simNo, dvrCard, driverMobile, monitorMobile, loginName, logTime, password, listenIp, listenPort, routes, lastCheckTime, updateLogDate, onlineTime, offlineTime);
    }
}
